package org.lilred.nzbberry.ui;

import org.lilred.nzbberry.config.Resizer;
import org.lilred.nzbberry.util.FontFactory;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;

public class BannerField extends Field {
	private String line1;
	private String line2;
	
	public BannerField() {
		this.line1 = "";
		this.line2 = "";
	}
	
	public BannerField(String line1, String line2) {
		this.line1 = line1;
		this.line2 = line2;
	}

	public void updateBanner(String line1, String line2) {
		this.line1 = line1;
		this.line2 = line2;
		invalidate();
	}

	protected void layout(int width, int height) {
		setExtent(width, height);
	}

	protected void paint(Graphics g) {
		g.setColor(0xFFFFFF);
		g.setFont(FontFactory.getFont(Resizer.resize(18)));
		g.drawText(line1, Resizer.resize(12), Resizer.resize(10));
		g.drawText(line2, Resizer.resize(12), Resizer.resize(28));
	}
}
